package com.s2sh.service.impl;

import java.util.List;

import com.s2sh.dao.PersonDao;
import com.s2sh.domain.Person;
import com.s2sh.service.PersonService;

public class PersonServiceImpl implements PersonService {
	
	private PersonDao personDao ;

	public void setPersonDao(PersonDao personDao) {
		this.personDao = personDao;
	}

	@Override
	public void savePerson(Person person) {
		personDao.savePerson(person) ;
	}

	@Override
	public void updatePerson(Person person) {
		personDao.updatePerson(person) ;
	}

	@Override
	public void deletePerson(Long id) {
		personDao.deletePerson(id) ;
	}

	@Override
	public List<Person> findAll() {
		List<Person> list = personDao.findAll() ;
		return list;
	}

	@Override
	public Person findById(Long id) {
		Person person = personDao.findById(id) ;
		return person;
	}

	@Override
	public void batchSavePerson(Integer saveNum) {
		personDao.saveBatchPerson(saveNum) ;
	}

	@Override
	public List<Person> findByPage(Integer firstResult, Integer maxResult) {
		List<Person> list = personDao.findByPage(firstResult, maxResult) ;
		return list;
	}

}
